import request from '@/utils/request'
import downloader from '@/utils/downloader'

//治疗师分页
export function therapistList(data) {
	return request({
		url: '/admin/user/therapist/list',
		method: 'get',
		params: data
	})
}

//获取系统用户信息
export function adminUserInfo(data) {
	return request({
		url: '/user/userInfo',
		method: 'get',
		params: data
	})
}

//添加治疗师
export function therapistSave(data) {
	return request({
		url: '/admin/user/therapist/add',
		method: 'post',
		data
	})
}

//修改治疗师
export function therapistrUpdate(data) {
	return request({
		url: '/admin/user/therapist/update',
		method: 'post',
		data
	})
}

//重置系统用户密码
export function resetPassword(data) {
	return request({
		url: '/admin/user/therapist/resetPassword',
		method: 'PUT',
		params: data
	})
}

//删除治疗师
export function therapistRemove(data) {
	return request({
		url: '/admin/user/therapist/delete',
		method: 'DELETE',
		params: data
	})
}

//批量导入系统用户
export function importAdminUser(data) {
	return request({
		url: '/admin/user/importUser',
		method: 'post',
		data
	})
}

//导出系统用户
export function adminUserExport(data) {
	return downloader({
		url: '/admin/user/userExport',
		method: 'get',
		params: data
	})
}

//修改用户密码
export function updatePassword(data) {
	return request({
		url: '/admin/user/adminUser/updatePassword',
		method: 'post',
		params: data
	})
}

//下载模板
export function downloadTemplate(data) {
	return downloader({
		url: '/admin/user/download',
		method: 'get',
		params: data
	})
}

//上传文件-共用
export function uploadFile(data) {
	return request({
		url: '/admin/user/adminUser/uploadFile',
		method: 'post',
		data
	})
}

//获取用户名是否存在
export function selectUsernameIsExist(data) {
	return request({
		url: '/admin/user/adminUser/selectUsernameIsExist',
		method: 'get',
		params: data
	})
}

//获取当前用户部门下用户
export function adminUserListByDeptId(data) {
	return request({
		url: '/admin/user/adminUser/adminUserListByDeptId',
		method: 'get',
		params: data
	})
}


//查询
export function majorInfoList(data) {
	return request({
		url: '/admin/user/adminUser/adminUserMajorList',
		method: 'get',
		params: data
	})
}

// 获取系统设定的工作时间
export function getTimeConf(data) {
	return request({
		url: '/admin/plan/therapistPlan/getTimeConf',
		method: 'get',
		params: data
	})
}

// 设置系统工作时间 

export function setTimeConf(data) {
	return request({
		url: '/admin/plan/therapistPlan/setTimeConf',
		method: 'POST',
		data
	})
}